package com.example.jdk_demo1;

import java.util.Observable;
import java.util.Observer;

public class DemoTest {

    public static void main(String[] args) {

        //观察目标
        ConcreteSubject observable = new ConcreteSubject();

        //观察者
        Observer observer = new ConcreteObserver();
        observable.addObserver(observer);
        observable.changeState();
    }
}
